/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						      color_count.h

	$Header: /resource_editor/color_count.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef COLOR_COUNT_H_INCLUDED
#define COLOR_COUNT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#pragma warning( disable: 4786 )

#include <list>
#include "counted_ptr.h"
#include "sized_int_types.h"

struct t_pixel_24;
//------------------------------------------------------------
// color_count.h
// -----------------------------------------------------------
enum t_axis
{
	k_red_axis,
	k_green_axis,
	k_blue_axis
};

//------------------------------------------------------------
// class to record statistics about a particular color, in
// preparation for palletization.
//------------------------------------------------------------
struct t_color_count : public t_counted_object
{
	t_color_count( t_pixel_24 const& pixel );

	int        count;
	t_uint16   index;    // index after palettization
	t_uint8    color[3];
	int        product[3];
	__int64    square_sum;
};

typedef t_counted_ptr<t_color_count> t_color_count_ptr;
typedef std::list<t_color_count_ptr> t_color_count_list;

#endif // COLOR_COUNT_H_INCLUDED